﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:Phone7ActionPack_Behaviors_Actions="clr-namespace:Phone7ActionPack.Actions;assembly=Phone7ActionPack" 
    xmlns:Phone7ActionPack_Behaviors_Controls="clr-namespace:Phone7ActionPack.Controls;assembly=Phone7ActionPack"
	mc:Ignorable="d"
	x:Class="Phone7ActionPack_SampleApp1.PhoneFileSource"
	d:DesignWidth="480" d:DesignHeight="800">

	<UserControl.Resources>
		<DataTemplate x:Key="DataTemplate1">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="0.298*"/>
					<ColumnDefinition Width="0.702*"/>
				</Grid.ColumnDefinitions>
				<TextBlock Margin="0,0,39,1" TextWrapping="Wrap" Text="{Binding FileSystemType}" d:LayoutOverrides="Width, Height" FontSize="18.667"/>
				<TextBlock Margin="0,0,39,1" TextWrapping="Wrap" Text="{Binding Name}" d:LayoutOverrides="Width, Height" Grid.Column="1"/>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>
	<UserControl.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</UserControl.Foreground>
	<UserControl.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</UserControl.FontFamily>
	<UserControl.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</UserControl.FontSize>

	<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">

	<!--ContentGrid is empty. Place new content here-->
		<Grid x:Name="ContentGrid" Margin="0,90,0,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="0.113*"/>
				<RowDefinition Height="0.752*"/>
				<RowDefinition Height="0.134*"/>
			</Grid.RowDefinitions>
			<TextBox x:Name="textBox" Margin="8,8,153,-6" TextWrapping="Wrap" d:LayoutOverrides="Height"/>
			<Button x:Name="CreateDirectory" Content="D" HorizontalAlignment="Right" Width="75" Margin="0,8,78,-6" Tag="{Binding Text, ElementName=textBox}" d:LayoutOverrides="Height">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<Phone7ActionPack_Behaviors_Actions:CallMethodAction TargetName="phoneFileDataSource" MethodArgumentPath="Tag" MethodName="CreateDirectory"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>
			<Button x:Name="CreateFile" Content="F" HorizontalAlignment="Right" Width="75" Margin="0,8,3,-6" Tag="{Binding Text, ElementName=textBox}" d:LayoutOverrides="Height">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<Phone7ActionPack_Behaviors_Actions:CallMethodAction TargetName="phoneFileDataSource" MethodArgumentPath="Tag" MethodName="CreateFile"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>
			<ToggleButton x:Name="ShowFiles" Content="ToggleButton" HorizontalAlignment="Left" Margin="8,-4,0,-5" Grid.Row="2" Style="{StaticResource PhoneToggleSwitch}" d:LayoutOverrides="Height" IsChecked="{Binding ShowFiles, ElementName=phoneFileDataSource, Mode=TwoWay}"/>
			<ToggleButton x:Name="ShowDirectories" Content="ToggleButton" HorizontalAlignment="Right" Margin="0,-4,99,-5" Grid.Row="2" Style="{StaticResource PhoneToggleSwitch}" d:LayoutOverrides="Height" IsChecked="{Binding ShowDirectories, ElementName=phoneFileDataSource, Mode=TwoWay}"/>
			<ScrollViewer Margin="4" Grid.Row="1">
				<ItemsControl x:Name="itemsControl" Height="526" Width="472" ItemsSource="{Binding FileSystemItems, ElementName=phoneFileDataSource}" ItemTemplate="{StaticResource DataTemplate1}"/>
			</ScrollViewer>
		</Grid>
		<Phone7ActionPack_Behaviors_Controls:PhoneFileDataSource x:Name="phoneFileDataSource" HorizontalAlignment="Left" Margin="0,0,0,758" Width="100"/>
	</Grid>
</UserControl>